<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标悬停效果</title>
    <style>
        div {
            height: 200px;
            width: 250px;
            transition: all 0.3s ease;
        }

        .mi {
            background-image: url(image/手机.jpg);
            background-size: cover;
            background-repeat: no-repeat;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            cursor: pointer;
        }

        .tian {
            background-image: url(image/天猫商品2.jpg);
            background-size: cover;
            background-repeat: no-repeat;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-end;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 3px solid;

        }

        .container {
            background-image: url(image/手机.jpg);
            background-size: cover;
            background-repeat: no-repeat;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-end;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 3px solid;

        }

        .container:hover {
            background-image: url(image/天猫商品2.jpg);
        }

        .tian:hover {
            border-color: rgb(209, 142, 15)
        }

        .s-mi {
            position: relative;
            /* bottom:0%;
            left: 50%; */
            width: 80px;
            height: 20px;
            overflow: hidden;
            border-radius: 10%;
        }

        .s-tian {
            position: relative;
            width: 80px;
            height: 20px;
            overflow: hidden;
            border-radius: 10%;
            color: red;
        }

        .s-mi2:hover {
            color: white;
            background-color: rgb(76, 76, 163);
        }
    </style>
</head>

<body>
    <h3>小米商城</h3>
    <div class="mi">
        <div class="s-mi">
            <font color="red">￥6999</font>
        </div>
        <div class="s-mi s-mi2">立即购买</div>
    </div>
    <h3>天猫商城</h3>
    <div class="tian">
        <div class="s-tian">￥250</div>
    </div>
    <h3>更换背景</h3>
    <div class="container"></div>
</body>

</html>